import Login from '../views/Login1.vue'
import manager from '../views/manager.vue'
import Abstract from '../views/abstract.vue'
import NotFound from '../views/404.vue'
import Main from '../views/index.vue'
import map from '../views/project/map.vue'

import analyzePlat from "../views/analyzePlat/analyzePlat.vue";
import dataSpace from '../views/space/dataSpace';
// import personalData from '../views/space/personalData';
import personalData1 from '../views/space/personalData1';
import personalDataset from '../views/space/personalDataset';
import publicDataset from '../views/space/publicDataset'
import personalService from '../views/space/personalService';
import publicService from '../views/space/publicService';
import personalModel from '../views/analyzePlat/personalModel';
import publicModel from '../views/analyzePlat/publicModel'
// import workflow from '../views/toolbox/zdworkflow'
import newAnalysis from '../views/analyzePlat/newAnalysis';
import missionManager from '../views/analyzePlat/missionManager';
// import personalSet from '../views/personalSet';
// import backendManager from '../views/backendManager';


export const loginRouter = {
    path: '/login',
    name: 'login',
    meta: {
        title: '登录',
    },
    icon: 'fa fa-user-circle-o fa-lg',
    component: Login,
};
export const managerRouter = {
    path: '/manager',
    name: 'manager',
    meta: {
        title: '管理系统',
    },
    icon: 'fa fa-user-circle-o fa-lg',
    component: manager,
};
export const loginRouter2 = {
    path: '*',
    redirect: '/login',
};

export const appRouter = [
    {
        meta: {
            title: '首页',
        },
        path: '/map',
        component: map,
        name: 'map',
        iconCls: 'el-icon-message',
    },
    {
        meta: {
            title: '公共资源',
        },
        path: '/public',
        component: Abstract,
        name: 'public',
        iconCls: 'el-icon-message',
        children:[
            {
                meta: {
                    title: '公共数据集',
                },
                path: '/publicDataset',
                component: publicDataset,
                name: 'publicDataset',
                iconCls: 'el-icon-message'},
            {
                meta: {
                    title: '公共服务',
                },
                path: '/publicService',
                component: publicService,
                name: 'publicService',
                iconCls: 'el-icon-message',
            },
            {
                meta: {
                    title: '公共模型',
                },
                path: '/publicModel',
                component: publicModel,
                name: 'publicModel',
                iconCls: 'el-icon-message',
            },

        ]
    },
    {
        meta: {
            title: '用户空间',
        },
        path: '/personal',
        component: Abstract,
        name: 'personal',
        iconCls: 'el-icon-message',
        children: [{
            meta: {
                title: '数据空间',
            },
            path: '/dataSpace',
            component: dataSpace,
            name: 'dataSpace',
            iconCls: 'el-icon-message',
        },
            {
                meta: {
                    title: '数据监控',
                },
                path: '/personalDataMonitor',
                component: personalData1,
                name: 'personalDataMonitor',
                iconCls: 'el-icon-message',
            },
            {
                meta: {
                    title: '用户数据集',
                },
                path: '/personalDataset',
                component: personalDataset,
                name: 'personalDataset',
                iconCls: 'el-icon-message',
            },
            {
                meta: {
                    title: '用户服务',
                },
                path: '/personalService',
                component: personalService,
                name: 'personalService',
                iconCls: 'el-icon-message',
            },
            {
                meta: {
                    title: '用户模型',
                },
                path: '/personalModel',
                component: personalModel,
                name: 'personalModel',
                iconCls: 'el-icon-message',
            },
            ]
    },
    {
        meta: {
            title: '分析平台',
        },
        path: '/analysis',
        component: Abstract,
        name: 'analyzePlat',
        iconCls: 'el-icon-message',
        children: [
        //     {
        //     meta: {
        //         title: '我的模型',
        //     },
        //     path: '/personalModel',
        //     component: personalModel,
        //     name: 'personalModel',
        //     iconCls: 'el-icon-message',
        // },
            // {
        //     meta: {
        //         title: '工作流构建',
        //     },
        //     path: '/workflow',
        //     component: workflow,
        //     name: 'workflow',
        //     iconCls: 'el-icon-message',
        // },
            {
            meta: {
                title: '新建分析',
            },
            path: '/newAnalysis',
            component: newAnalysis,
            name: 'newAnalysis',
            iconCls: 'el-icon-message',
        }, {
            meta: {
                title: '任务管理',
            },
            path: '/missionManager',
            component: missionManager,
            name: 'missionManager',
            iconCls: 'el-icon-message',
        }]
    },
    // {
    //     meta: {
    //         title: '后台管理',
    //     },
    //     path: '/backend',
    //     component: Abstract,
    //     name: 'backendManager',
    //     iconCls: 'el-icon-message',
    // },
    // {
    //     meta: {
    //         title: '设置',
    //     },
    //     path: '/setup',
    //     component: personalSet,
    //     name: 'setup',
    //     iconCls: 'el-icon-message',
    //
    // },
    // {
    //     path: '*',
    //     hidden: true,
    //     redirect: {path: '/404'}
    // }
];
//TODO 修改不加路径时跳转的url地址

export const mainRouter = {
    path: '/',
    // redirect: '/dataSource/pubData',
    redirect: '/login',
    // redirect: '/map',
    name: 'index',
    meta: {
        title: '首页'
    },
    component: Main,
    children: appRouter
};


export const routers = [
    loginRouter,
    mainRouter,
    loginRouter2,
    managerRouter
];
